// app.js
import api from 'api/index.js';
App({
  onLaunch() {
    // 展示本地存储能力
    // const logs = wx.getStorageSync('logs') || []
    // logs.unshift(Date.now())
    // wx.setStorageSync('logs', logs)
    //是否同意隐私协议
   


    //登录
    wx.login({
      success: res => {
        // console.log(res)
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    });

    wx.getSystemInfo({
      success: (result) => {
        this.globalData.statusBarHeight = result.statusBarHeight;
      },
    });
    //监听路由变化时
    wx.onAppRoute((res) => {
      this.globalData.isShowPrompt = false; //改变提示框状态 
    });
    //是否显示我要测额
    api.plainDictionary('app_is_examine').then(res => {
      this.globalData.app_is_examine = res.data.data[0].itemValue == '1' ? false : true
    });
   
  },
  onShow() {
   
  },
  globalData: {
    userInfo: null,
    statusBarHeight: '', //状态栏高度
    isShowPrompt: false, //是否显示未登录提示弹层
    showDialog: false, //首页消息推送查看
    app_is_examine: '' //是否审核版本
  },

})